package gameAppLayer.gui;

import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.builder.LayerBuilder;
import de.lessvoid.nifty.builder.PanelBuilder;
import de.lessvoid.nifty.builder.ScreenBuilder;
import de.lessvoid.nifty.builder.TextBuilder;
import de.lessvoid.nifty.controls.button.builder.ButtonBuilder;
import de.lessvoid.nifty.screen.Screen;
import effects.MoveEffectBuilder;

public class FGUIMods {
	
	public Screen createScreen(Nifty nifty) {

		Screen modScreen = new ScreenBuilder(EGUIStates.MODS.toString()) {{
			controller(new CGUIMods());

			//inputMapping("de.lessvoid.nifty.input.mapping.DefaultScreenMapping");

			layer(new LayerBuilder("backgroundLayer") {{				
				backgroundImage("assets/Interface/Backgrounds/HubbleGalaxy3.png");				
			}});

			layer(new LayerBuilder("contentLayer") {{
				backgroundColor("#fff0");
				childLayoutVertical();

				panel(new PanelBuilder("middle") {{
					backgroundColor("#0005");
					//backgroundColor("#0f06");
					childLayoutCenter();
					width(percentage(20));
					//height(percentage(40));
					alignCenter();
					valignCenter();
					height("*");
					visibleToMouse();
					padding(pixels(10));

					onStartScreenEffect(new MoveEffectBuilder() {{
						mode(inMode());
						direction(leftDirection());
						length(500);
						startDelay(0);
						inherit(true);
					}});

					onEndScreenEffect(new MoveEffectBuilder() {{
						mode(outMode());
						direction(rightDirection());
						length(500);
						startDelay(0);
						inherit(true);						
					}});

					panel(new PanelBuilder("menu-mods") {{
						childLayoutVertical();
						alignCenter();
						valignCenter();
						width(percentage(100));

						text(new TextBuilder() {{
							text("This screen will allow for the loading of mods.");
							font("aurulent-sans-16.fnt");
							color("#000f");
							width("*");
							alignCenter();
							valignCenter();
							
							padding(pixels(50));
						}});
						
						control(new ButtonBuilder("backButton", "< Back") {{ //play
							width(pixels(100));
							alignCenter();
							valignCenter();

							interactOnClick("back()");							
						}});

					}});
				}});
			}});
		}}.build(nifty);
		
		
		return modScreen;

	}

}
